package com.rongji.dfish.ui.json;

import java.util.Stack;

import com.rongji.dfish.base.util.StringUtil;

/**
 * BaseJsonBuilder 为基础类型的JSON转化器
 * 如Boolean boolean Integer int Long long等 
 * @author DFish Team
 *
 */
public class BaseJsonBuilder extends AbstractJsonBuilder{

	public void buildJson(Object o, StringBuilder sb,Stack<PathInfo> path,JsonBuilderParam jbp) {
		if(o!=null&&jbp.getNumberFormat()!=null&&(o instanceof Double||o instanceof Float)){
			sb.append(StringUtil.format(o, jbp.getNumberFormat()));
		}else{
			sb.append(o);
		}
	}

}
